[Fix] Flip yaw angle for DepthInstance3DBoxes.overlaps #1548
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
This fix is separated from FCAF3D PR #1547 after a small discussion with @ZwwWayne.
While working on that PR I've checked my FCAF3D checkpoints for ScanNet, SUN RGB-D and S3DIS from
mmdetectiontion3d==0.15.0
. And for ScanNet and S3DIS metrics were exactly the same, unlike SUN RGB-D with mAP@0.5 less then expected by ~3%. After some debugging I saw that the model is fine, but the difference is caused by the evaluation function. And basically the difference is inBaseInstance3DBoxes.overlaps
. The difference is not that big, i.e.test_indoor_eval
successfully passes with this fix and without it. But, maybe it is a bug.As I understand we call
mmcv.ops.box_iou_rotated
inBaseInstance3DBoxes.overlaps
and this function is designed for anti-clockwise heading angle. So it is probably ok forLidarInstance3DBoxes
. But forDepthInstance3DBoxes
the yaw angle is clockwise, so we need to flip the angle ofboxes1
andboxes1
before callingmmcv.ops.box_iou_rotated
.Also the issue is critical as it has a little affect on
indoor_eval
and сonsequently on all indoor models. I have tried the VoteNet checkpoint and the affect of this PR is minimal, e.g. <1% . However looks like VoteNet is 15% mAP@0.5 less than it should be in currentdev
branch. I'm not sure about the reason. May be it should be retrained, or the bug is introduced innms3d
oriou3d
refactoring in last 2 months.Modification
Inherit
DepthInstance3DBoxes.overlaps
fromBaseInstance3DBoxes.overlaps
.BC-breaking
Yes.